package com.learn.actionplatfo.service;

import com.learn.actionplatfo.Mapper.GoodMapper;
import com.learn.actionplatfo.bean.Good;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodService {

    @Autowired
    GoodMapper goodMapper;

    public List<Good> getAllGood(){
        return goodMapper.getAllGood();
    }

    public Good getGoodByName(String goodName){
        return goodMapper.getGoodByName(goodName);
    }

    public List<Good> getGoodByVagueName(String goodVagueName){
        return goodMapper.getGoodByVagueName(goodVagueName);
    }

    public List<Good> getGoodByAttribute(String goodAttribute){
        return goodMapper.getGoodByAttribute(goodAttribute);
    }

    public List<Good> getGoodBy1stand2ndClassification(String fristClass,String secondClass){
        return goodMapper.getGoodBy1stand2ndClassification(fristClass,secondClass);
    }

    public List<Good> getGoodBy1stClassification(String fristClassification){
        return goodMapper.getGoodBy1stClassification(fristClassification);
    }

    public List<Good> getGoodBy2ndClassification(String secondClassification){
        return goodMapper.getGoodBy2ndClassification(secondClassification);
    }

    public List<Good> getGoodByState(int goodState){
        return goodMapper.getGoodByState(goodState);
    }

    public int addGood(Good good){return goodMapper.addGood(good);}

    public int getAllGoodMaxId(){
        return goodMapper.getAllGoodMaxId();
    }

    public int updateGood(Good good){
        return goodMapper.updateGood(good);
    }

    public Good getGoodById(int id){
        return goodMapper.getGoodById(id);
    }
}
